package main

import (
	"api-manager-server/core"
	"api-manager-server/global"
	"api-manager-server/initialize"
	"context"
)

func init() {
	// 初始化配置文件
	global.Config = initialize.InitConfig()
	// 初始化日志配置
	global.Logger = initialize.InitZapLogger()
	// 初始化Mongodb 连接
	mongo := global.Config.Mongodb
	global.Mongo, global.DB = initialize.InitMongoClient(mongo.Link(), mongo.Database)
}

func main() {
	core.RunWindowsServer()
	defer global.Mongo.Disconnect(context.TODO())
}
